package com.v1.video.activity;

import java.util.ArrayList;
import java.util.List;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.iss.view.pulltorefresh.PullToRefreshBase;
import com.iss.view.pulltorefresh.PullToRefreshBase.Mode;
import com.iss.view.pulltorefresh.PullToRefreshBase.OnRefreshListener2;
import com.iss.view.pulltorefresh.PullToRefreshListView;
import com.v1.video.R;
import com.v1.video.domain.MyShouYiPageInfo;
import com.v1.video.domain.MyShouYiPageObj;
import com.v1.video.domain.RewardInfo;
import com.v1.video.engine.NetEngine;
import com.v1.video.util.Logger;
import com.v1.video.util.Utils;

/**
 * 我的收益
 * @author fengtao
 *
 */
public class MyShouYiActivity extends BaseActivity{

	private final String TAG = "MyShouYiActivity";
	private ListView listView_my_zanShang;
	PullToRefreshListView refreshView_my_zanShang = null;
	private ListView listView_my_zanShang_other;
	PullToRefreshListView refreshView_my_zanShang_other = null;
	private ListView listView_tixian;
	PullToRefreshListView refreshView_tixian = null;
	
	private boolean isMyZanShang = true;
	private boolean isZanShangOther = false;
	private boolean isTixianTips = false;
	
	private TextView txtMyZan = null;
	private TextView txtMyZanOther = null;
	private TextView txtMyTiXian = null;
	
	List<RewardInfo> rewardInfos = new ArrayList<RewardInfo>();
	List<RewardInfo> rewardInfoOthers = new ArrayList<RewardInfo>();
	List<RewardInfo> rewardInfoTixians = new ArrayList<RewardInfo>();
	AdapterMyZan adapterMyZan = null;
	AdapterMyZanOther adapterMyZanOther = null;
	AdapterMyTixian adapterMyTixian = null;
	LinearLayout layoutTotalMoneyBack = null;
	TextView txtMoney = null;
	View line_1 = null;
	private final int PAGE_SIZE = 20;
	private int pageIndexMyZan = 1;
	private int pageIndexZanOther = 1;
	private int pageIndexMyTiXian = 1;
	private int style = 0;//状态：时入哪一个状态下：0：我的赞赏，1：赞赏他人，2：提现记录
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_my_shouyi);
	}

	@Override
	protected void initView() {
		// TODO Auto-generated method stub
		
		((TextView)findViewById(R.id.tv_title)).setText(R.string.myself_shouyi);
		refreshView_my_zanShang = (PullToRefreshListView) findViewById(R.id.myshouyi_zanshang);
		refreshView_my_zanShang.setScrollingWhileRefreshingEnabled(false);
		refreshView_my_zanShang.setMode(Mode.BOTH);
		listView_my_zanShang = refreshView_my_zanShang.getRefreshableView();
		refreshView_my_zanShang_other = (PullToRefreshListView) findViewById(R.id.myshouyi_zanshang_other);
		refreshView_my_zanShang_other.setScrollingWhileRefreshingEnabled(false);
		refreshView_my_zanShang_other.setMode(Mode.BOTH);
		listView_my_zanShang_other = refreshView_my_zanShang_other.getRefreshableView();
		refreshView_tixian = (PullToRefreshListView) findViewById(R.id.myshouyi_tixian);
		refreshView_tixian.setScrollingWhileRefreshingEnabled(false);
		refreshView_tixian.setMode(Mode.BOTH);
		listView_tixian = refreshView_tixian.getRefreshableView();
		
		txtMyZan = (TextView)findViewById(R.id.myshouyi_txt_my_zanshang);
		txtMyZanOther = (TextView)findViewById(R.id.myshouyi_txt_zanshang_other);
		txtMyTiXian = (TextView)findViewById(R.id.myshouyi_txt_tixian_tips);
		
		layoutTotalMoneyBack = (LinearLayout)findViewById(R.id.myshouyi_tixian_totalmoney_back);
		txtMoney = (TextView)findViewById(R.id.myshouyi_tixian_totalmoney);
		line_1 = (View)findViewById(R.id.myshouyi_line_1);
	}

	@Override
	protected void initData() {
		// TODO Auto-generated method stub
		Intent intent = this.getIntent();
		style = intent.getIntExtra("rewardStyle", 0);
		if(style == 0){
			isMyZanShang = true;
			isZanShangOther = false;
			isTixianTips = false;
		}else if(style == 1){
			isMyZanShang = false;
			isZanShangOther = true;
			isTixianTips = false;
		}else if(style == 2){
			isMyZanShang = false;
			isZanShangOther = false;
			isTixianTips = true;
		}
		titleInit();
		if(isMyZanShang){
			new GetDataAsync(0,pageIndexMyZan).execute();
		}else if(isZanShangOther){
			new GetDataAsync(1,pageIndexZanOther).execute();
		}else if(isTixianTips){
			new GetDataAsync(2,pageIndexMyTiXian).execute();
		}
	}
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
	}

	private void titleInit(){
		if(isMyZanShang){
			titleMyZanInit();
		}else if(isZanShangOther){
			titleMyZanOtherInit();
		}else if(isTixianTips){
			titleTiXianInit();
		}
	}

	private void titleTiXianInit() {
		isZanShangOther = false;
		isMyZanShang = false;
		isTixianTips = true;
		txtMyZan.setTextColor(getResources().getColor(R.color.black));
		txtMyZan.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		txtMyZanOther.setTextColor(getResources().getColor(R.color.black));
		txtMyZanOther.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		txtMyTiXian.setTextColor(getResources().getColor(R.color.color_blue));
		txtMyTiXian.setBackgroundColor(getResources().getColor(R.color.white));
		refreshView_my_zanShang.setVisibility(View.GONE);
		refreshView_my_zanShang_other.setVisibility(View.GONE);
		refreshView_tixian.setVisibility(View.VISIBLE);
		layoutTotalMoneyBack.setVisibility(View.VISIBLE);
		line_1.setVisibility(View.GONE);
	}

	private void titleMyZanOtherInit() {
		isTixianTips = false;
		isMyZanShang = false;
		isZanShangOther = true;
		txtMyZan.setTextColor(getResources().getColor(R.color.black));
		txtMyZan.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		txtMyZanOther.setTextColor(getResources().getColor(R.color.color_blue));
		txtMyZanOther.setBackgroundColor(getResources().getColor(R.color.white));
		txtMyTiXian.setTextColor(getResources().getColor(R.color.black));
		txtMyTiXian.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		refreshView_my_zanShang.setVisibility(View.GONE);
		refreshView_my_zanShang_other.setVisibility(View.VISIBLE);
		refreshView_tixian.setVisibility(View.GONE);
		layoutTotalMoneyBack.setVisibility(View.GONE);
		line_1.setVisibility(View.VISIBLE);
	}

	private void titleMyZanInit() {
		isMyZanShang = true;
		isTixianTips = false;
		isZanShangOther = false;
		txtMyZan.setTextColor(getResources().getColor(R.color.color_blue));
		txtMyZan.setBackgroundColor(getResources().getColor(R.color.white));
		txtMyZanOther.setTextColor(getResources().getColor(R.color.black));
		txtMyZanOther.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		txtMyTiXian.setTextColor(getResources().getColor(R.color.black));
		txtMyTiXian.setBackgroundColor(getResources().getColor(R.color.color_page_bg));
		refreshView_my_zanShang.setVisibility(View.VISIBLE);
		refreshView_my_zanShang_other.setVisibility(View.GONE);
		refreshView_tixian.setVisibility(View.GONE);
		layoutTotalMoneyBack.setVisibility(View.GONE);
		line_1.setVisibility(View.VISIBLE);
	}

	@Override
	protected void setListener() {
		// TODO Auto-generated method stub
		txtMyZan.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				titleMyZanInit();
				if(adapterMyZan == null){
					new GetDataAsync(0,pageIndexMyZan).execute();
				}else{
					refreshView_my_zanShang.setVisibility(View.VISIBLE);
				}
			}
		});
		txtMyZanOther.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				titleMyZanOtherInit();
				if(adapterMyZanOther == null){
					new GetDataAsync(1,pageIndexZanOther).execute();
				}else{
					refreshView_my_zanShang_other.setVisibility(View.VISIBLE);
				}
			}
		});
		txtMyTiXian.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				titleTiXianInit();
				if(adapterMyTixian == null){
					new GetDataAsync(2,pageIndexMyTiXian).execute();
				}else{
					refreshView_tixian.setVisibility(View.VISIBLE);
				}
			}
		});
		findViewById(R.id.lay_result).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MyShouYiActivity.this, MainPageNewActivity.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
				intent.putExtra("tag", MainPageNewActivity.FLAG_PERSONAL);
				startActivity(intent);
				finish();
			}
		});
		refreshView_my_zanShang.setOnRefreshListener(new OnRefreshListener2<ListView>() {

			@Override
			public void onPullDownToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				String label = DateUtils.formatDateTime(
						getApplicationContext(), System.currentTimeMillis(),
						DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE
								| DateUtils.FORMAT_ABBREV_ALL);

				// Update the LastUpdatedLabel
				refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
				Logger.i(TAG, "下拉刷新");
				pageIndexMyZan = 1;
				new GetDataAsync(0,pageIndexMyZan).execute();
			}

			@Override
			public void onPullUpToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				Logger.i(TAG, "上拉加载");
				pageIndexMyZan++;
				new GetDataAsync(0,pageIndexMyZan).execute();
			}
		});
		refreshView_my_zanShang_other.setOnRefreshListener(new OnRefreshListener2<ListView>() {

			@Override
			public void onPullDownToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				String label = DateUtils.formatDateTime(
						getApplicationContext(), System.currentTimeMillis(),
						DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE
								| DateUtils.FORMAT_ABBREV_ALL);

				// Update the LastUpdatedLabel
				refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
				pageIndexZanOther = 1;
				new GetDataAsync(1,pageIndexZanOther).execute();
			}

			@Override
			public void onPullUpToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				pageIndexZanOther++;
				new GetDataAsync(1,pageIndexZanOther).execute();
			}
		});
		refreshView_tixian.setOnRefreshListener(new OnRefreshListener2<ListView>() {

			@Override
			public void onPullDownToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				String label = DateUtils.formatDateTime(
						getApplicationContext(), System.currentTimeMillis(),
						DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE
								| DateUtils.FORMAT_ABBREV_ALL);

				// Update the LastUpdatedLabel
				refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
				pageIndexMyTiXian = 1;
				new GetDataAsync(2,pageIndexMyTiXian).execute();
			}

			@Override
			public void onPullUpToRefresh(
					PullToRefreshBase<ListView> refreshView) {
				pageIndexMyTiXian++;
				new GetDataAsync(2,pageIndexMyTiXian).execute();
			}
		});
	}
	
	/**
     * 获取数据
     */
    private class GetDataAsync extends AsyncTask<Void, Void, Boolean> {
        
        private String errorMsg = "";
        private MyShouYiPageInfo myPageInfo = null;
        private ProgressDialog pd;
        private int type = 0;
        private int page = 1;
        public GetDataAsync(int type,int page) {                        
           this.type = type;
           this.page = page;
        }
        
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pd = Utils.getProgressDialog(MyShouYiActivity.this,getResources().getString(R.string.get_data), this);
            pd.show();
        }
        
        @Override
        protected Boolean doInBackground(Void... params) {
            try {
                NetEngine engine = new NetEngine();
                if(type == 0){
                	myPageInfo = engine.getMyshouyiOfMyZanShang(""+page, ""+PAGE_SIZE);
                }else if(type == 1){
                	myPageInfo = engine.getMyshouyiOfZanShangOther(""+page, ""+PAGE_SIZE);
                }else if(type == 2){
                	myPageInfo = engine.getMyshouyiOfTiXian(""+page, ""+PAGE_SIZE);
                }
            } catch (Exception e) {
                e.printStackTrace();
                errorMsg = e.getMessage();
            }
            return false;
            
        }
        @Override
        protected void onPostExecute(Boolean result) {
            super.onPostExecute(result);
            if(pd != null && pd.isShowing()){
                pd.cancel();
            }
            if (errorMsg.equals("")) {
            	if(type == 0){//我的赞赏
            		if(myPageInfo != null){
            			if(myPageInfo.getObj() != null){
            				if(page == 1){
            					if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() > 0){
            						rewardInfos.clear();
            						rewardInfos.addAll(myPageInfo.getObj().getRows());
            					}
            				}else{
            					rewardInfos.addAll(myPageInfo.getObj().getRows());
            				}
            				if(adapterMyZan == null){
                    			Logger.i(TAG, "这里执行了");
                    			adapterMyZan = new AdapterMyZan();
                    			listView_my_zanShang.setVisibility(View.VISIBLE);
                    			listView_my_zanShang.setAdapter(adapterMyZan);
                    		}else{
                    			adapterMyZan.notifyDataSetChanged();
                    		}
            				if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() < PAGE_SIZE){
            					pageIndexMyZan = 1;
            					refreshView_my_zanShang.setMode(Mode.PULL_DOWN_TO_REFRESH);
            				}else{
            					refreshView_my_zanShang.setMode(Mode.PULL_UP_TO_REFRESH);
            				}
            			}else{
            				toast(myPageInfo.getMsg());
            			}
            			
                		
            		}else{
            			toast("服务器繁忙，请稍后再试~");
            		}
            		
            	}else if(type == 1){//赞赏他人
            		if(myPageInfo != null){
            			if(myPageInfo.getObj() != null){
            				if(page == 1){
            					if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() > 0){
            						rewardInfoOthers.clear();
            						rewardInfoOthers.addAll(myPageInfo.getObj().getRows());
            					}
            				}else{
            					rewardInfoOthers.addAll(myPageInfo.getObj().getRows());
            				}
            				if(adapterMyZanOther == null){
    	            			Logger.i(TAG, "这里执行了");
    	            			adapterMyZanOther = new AdapterMyZanOther();
    	            			listView_my_zanShang_other.setVisibility(View.VISIBLE);
    	            			listView_my_zanShang_other.setAdapter(adapterMyZanOther);
    	            		}else{
    	            			adapterMyZanOther.notifyDataSetChanged();
    	            		}
            				if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() < PAGE_SIZE){
            					pageIndexZanOther = 1;
            					refreshView_my_zanShang_other.setMode(Mode.PULL_DOWN_TO_REFRESH);
            				}else{
            					refreshView_my_zanShang_other.setMode(Mode.PULL_UP_TO_REFRESH);
            				}
            			}else{
            				toast(myPageInfo.getMsg());
            			}
	            		
	            		
            		}else{
            			toast("服务器繁忙，请稍后再试~");
            		}
            	}else if(type == 2){//我的提现
            		if(myPageInfo != null){
            			if(myPageInfo.getObj() != null){
            				if(page == 1){
            					if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() > 0){
            						rewardInfoTixians.clear();
            						rewardInfoTixians.addAll(myPageInfo.getObj().getRows());
            					}
            				}else{
            					rewardInfoTixians.addAll(myPageInfo.getObj().getRows());
            				}
            				if(adapterMyTixian == null){
    	            			Logger.i(TAG, "这里执行了");
    	            			adapterMyTixian = new AdapterMyTixian();
    	            			listView_tixian.setVisibility(View.VISIBLE);
    	            			listView_tixian.setAdapter(adapterMyTixian);
    	            		}else{
    	            			adapterMyTixian.notifyDataSetChanged();
    	            		}
            				MyShouYiPageObj obj = myPageInfo.getObj();
            				
            				txtMoney.setText(getResources().getString(R.string.reward_myshouyi_tixian_money)
    	            				+obj.getTotalAmount()+
    	            				getResources().getString(R.string.reward_myshouyi_tixian_moneytips1)
    	            				+obj.getValidAmount()
    	            				+ getResources().getString(R.string.reward_myshouyi_tixian_moneytips2));
            				if(myPageInfo.getObj().getRows() != null && myPageInfo.getObj().getRows().size() < PAGE_SIZE){
            					pageIndexMyTiXian = 1;
            					refreshView_tixian.setMode(Mode.PULL_DOWN_TO_REFRESH);
            				}else{
            					refreshView_tixian.setMode(Mode.PULL_UP_TO_REFRESH);
            				}
            			}else{
            				toast(myPageInfo.getMsg());
            			}
	            		
            		}else{
            			toast("服务器繁忙，请稍后再试~");
            		}
            	}
            } else {
                toast(errorMsg);
            }
            if(refreshView_my_zanShang != null){
            	refreshView_my_zanShang.onRefreshComplete();
            }
            if(refreshView_my_zanShang_other != null){
            	refreshView_my_zanShang_other.onRefreshComplete();
            }
            if(refreshView_tixian != null){
            	refreshView_tixian.onRefreshComplete();
            }
        }
    }

    private class AdapterMyZan extends BaseAdapter {
		
		public AdapterMyZan() {
			
		}

		@Override
		public int getCount() {
			return rewardInfos.size();
		}

		@Override
		public Object getItem(int position) {
			return rewardInfos.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			ViewHolder holder = null;
			
			if (convertView != null && convertView instanceof LinearLayout)
				holder = (ViewHolder) convertView.getTag();
			else {
				holder = new ViewHolder();
				convertView = View.inflate(MyShouYiActivity.this,
						R.layout.item_my_shouyi_zanshang, null);
//				convertView
//						.setLayoutParams(new android.widget.AbsListView.LayoutParams(
//								LayoutParams.MATCH_PARENT, DensityUtil.dip2px(
//										MyShouYiActivity.this, 80)));
				holder.title = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_title);
				holder.userName = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_username);
				holder.money = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_money);
				holder.time = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_time);
				convertView.setTag(holder);
			}
			Logger.i(TAG, "getview 里也执行了");
			RewardInfo info = rewardInfos.get(position);
			holder.title.setText(info.getTitle());
			holder.money.setText(info.getAmount());
			holder.userName.setText("打赏人："+info.getFromUserName());
			holder.time.setText(info.getTime().substring(0, info.getTime().length()-3));
//			ImageLoader.getInstance().displayImage(cv.getImgUrl(), holder.iv,
//					Constant.IMAGE_OPTIONS_FOR_VIDEO, null);
			/*
			 * new SimpleImageLoadingListener() { public void
			 * onLoadingComplete(String imageUri, View view, Bitmap loadedImage)
			 * { ImageView iv = (ImageView) view;
			 * iv.setImageBitmap(loadedImage); } });
			 */
			return convertView;
		}

	}

	private static class ViewHolder {
		TextView title;
		TextView userName;
		TextView money;
		TextView time;
	}
	
	private class AdapterMyZanOther extends BaseAdapter {
		
		public AdapterMyZanOther() {
			
		}

		@Override
		public int getCount() {
			return rewardInfoOthers.size();
		}

		@Override
		public Object getItem(int position) {
			return rewardInfoOthers.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			ViewHolder holder = null;
			
			if (convertView != null && convertView instanceof LinearLayout)
				holder = (ViewHolder) convertView.getTag();
			else {
				holder = new ViewHolder();
				convertView = View.inflate(MyShouYiActivity.this,
						R.layout.item_my_shouyi_zanshang, null);
				holder.title = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_title);
				holder.userName = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_username);
				holder.money = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_money);
				holder.time = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_time);
				convertView.setTag(holder);
			}
			RewardInfo info = rewardInfoOthers.get(position);
			holder.title.setText(info.getTitle());
			holder.money.setText(info.getAmount());
			holder.userName.setText("作者："+info.getToUserName());
			holder.time.setText(info.getTime().substring(0, info.getTime().length()-3));
			return convertView;
		}
	}
	
	private class AdapterMyTixian extends BaseAdapter {
		
		public AdapterMyTixian() {
			
		}

		@Override
		public int getCount() {
			return rewardInfoTixians.size();
		}

		@Override
		public Object getItem(int position) {
			return rewardInfoTixians.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			ViewHolder holder = null;
			
			if (convertView != null && convertView instanceof LinearLayout)
				holder = (ViewHolder) convertView.getTag();
			else {
				holder = new ViewHolder();
				convertView = View.inflate(MyShouYiActivity.this,
						R.layout.item_my_shouyi_zanshang, null);
				holder.title = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_title);
				holder.userName = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_username);
				holder.money = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_money);
				holder.time = (TextView) convertView
						.findViewById(R.id.item_myshouyi_zanshang_time);
				convertView.setTag(holder);
			}
			RewardInfo info = rewardInfoTixians.get(position);
			holder.title.setText(info.getTitle());
			if(info.getStatus().equals("0")){
				holder.money.setText("申请中");
				holder.money.setTextColor(getResources().getColor(R.color.black_33));
			}else if(info.getStatus().equals("1")){
				holder.money.setText("提现成功");
				holder.money.setTextColor(getResources().getColor(R.color.red));
			}else if(info.getStatus().equals("2")){
				holder.money.setText("拒绝");
				holder.money.setTextColor(getResources().getColor(R.color.black_33));
			}
			holder.userName.setVisibility(View.GONE);
			holder.time.setText(info.getTime().substring(0, info.getTime().length()-3));
			return convertView;
		}

	}
}
